package org.greatstorm.util;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Utils {

	public static final String DATE_FORMAT_STR = "yyyy-MM-dd hh点mm分";

	/**
	 * get the entity key
	 * <p>
	 * NOTES
	 * </p>:<br>
	 * because only one owner to write article, so we needn't to sychronize the
	 * method!
	 * 
	 * @return
	 */
	public static String getKeyString() {

		long ret = 1L;
		ret = System.currentTimeMillis();
		try {
			Thread.sleep(20);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return String.valueOf(ret);
	}

	public static String formatDate(Date src, String toStr) {
		DateFormat formater = new SimpleDateFormat(toStr);
		return formater.format(src);
	}
}
